package com.dream.service.impl;

import com.dream.dao.UserDao;
import com.dream.dao.impl.UserDaoImpl;
import com.dream.pojo.User;
import com.dream.service.UserService;

import java.util.List;


public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDaoImpl();
    @Override
    public User login(User user) {
        return userDao.login(user);
    }
    @Override
    public int add(User user) {
        return userDao.add(user);
    }

    @Override
    public long totalCount(String userName) {
        return userDao.totalCount(userName);
    }

    @Override
    public List<User> list(String userName, long pageIndex, long pageSize) {
        return userDao.list(userName,pageIndex,pageSize);
    }

    @Override
    public User findById(String userId) {
        return userDao.findById(userId);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public int deleteById(String userId) {
        return userDao.deleteById(userId);
    }
}
